package com.car.controller.v1;

import com.itheima.apis.component.ComClassify2ControllerApi;
import com.itheima.apis.component.ComClassifyControllerApi;
import com.car.model.common.dtos.ResponseResult;
import com.car.model.component.dtos.ComClassifyDto;
import com.car.model.component.pojos.ComClassify2;
import com.car.service.ComClassify2Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/classify2")
public class ComClassify2Controller implements ComClassify2ControllerApi {


    @Autowired
    ComClassify2Service comClassify2Service;

    @PostMapping("/save")
    @Override
    public ResponseResult save(@RequestBody ComClassify2 classify) {
        return comClassify2Service.saveClassify(classify);
    }

    @DeleteMapping("/{id}")
    @Override
    public ResponseResult delete(@PathVariable("id") Integer id) {
        return comClassify2Service.delete(id);
    }

    @PostMapping("/update")
    @Override
    public ResponseResult update(@RequestBody ComClassify2 classify) {
        return comClassify2Service.updateClassify(classify);
    }

    @PostMapping("/findByPage")
    @Override
    public ResponseResult findByPage(@RequestBody ComClassifyDto dto) {
//        return comClassify2Service.findByPage(dto);
        return null;
    }
}
